/*
 * @Author: chen17
 * @Date: 2022-03-14 16:41:32
 * @LastEditTime: 2023-12-17 20:15:21
 * @Description: cookie管理
 */
import Cookies from 'js-cookie'

// token标识
const TokenKey = 'shunshun_token_'

// cookie过期时间 12 小时(已删除过期时间后有过期时间，前端设置过期后无法再次写入)
// const hours = 12 * 60 * 60 * 1000
// const expiresTime = new Date(new Date().getTime() + hours)

export function setToken(token) {
    Cookies.set(TokenKey + sessionStorage.getItem('userMark'), token)
}

export function getToken() {
    return Cookies.get(TokenKey + sessionStorage.getItem('userMark'))
}

export function removeToken() {
    return Cookies.remove(TokenKey + sessionStorage.getItem('userMark'))
}
